Updates the symbol to check for in the backtrace unit tests
authorNoah Meyerhans <noahm@debian.org>
Fri, 12 Jun 2020 23:51:06 +0000 (16:51 -0700)
committerNoah Meyerhans <noahm@debian.org>
Sat, 30 Jul 2022 02:58:28 +0000 (19:58 -0700)
Updates the symbol to check for in the backtrace unit tests to
something that appears in all the traces on the platforms we support.

Gbp-Pq: Name test-backtrace.patch

src/lib/test-backtrace.c

index fdebe0fd38282d45d7a48ce421ac82211ff5d96b..640dc5b8d06c6ee0a50313f585fcfeef6528c009 100644 (file)
@@ -17,8 +17,8 @@ static void test_backtrace_append(void)
 #elif (defined(HAVE_BACKTRACE_SYMBOLS) && defined(HAVE_EXECINFO_H)) || \
       (defined(HAVE_WALKCONTEXT) && defined(HAVE_UCONTEXT_H))
        test_assert(backtrace_append(bt) == 0);
-       /* it should have some kind of main in it */
-       test_assert(strstr(str_c(bt), "main") != NULL);
+       i_debug("backtrace: '%s'", str_c(bt));
+       test_assert(strstr(str_c(bt), "test_backtrace_append") != NULL || strstr(str_c(bt), "main") != NULL);
 #else
        /* should not work in this context */
        test_assert(backtrace_append(bt) == -1);
@@ -41,8 +41,8 @@ static void test_backtrace_get(void)
 #elif (defined(HAVE_BACKTRACE_SYMBOLS) && defined(HAVE_EXECINFO_H)) || \
       (defined(HAVE_WALKCONTEXT) && defined(HAVE_UCONTEXT_H))
        test_assert(backtrace_get(&bt) == 0);
-       /* it should have some kind of main in it */
-       test_assert(strstr(bt, "main") != NULL);
+       i_debug("backtrace: '%s'", bt);
+       test_assert(strstr(bt, "test_backtrace_get") != NULL || strstr(bt, "main") != NULL);
 #else
        /* should not work in this context */
        test_assert(backtrace_get(&bt) == -1);